package pers.leeyns.rd.bank;

import java.util.ArrayList;
import java.util.List;

import pers.leeyns.rd.base.BaseRandom;

/**
 * 生成19位银行卡号
 * @description TODO
 * @author Leeyns
 * @date 2016年2月17日
 */
public class RandomBankCodeGenerator extends BaseRandom{
	 
	/**
	 * 
	 */
	private static final long serialVersionUID = 7007617993760449644L;

	public static void main(String args[]){
		while(true)
			System.out.println(RandomBankCodeGenerator.build().generateBank().getBankNo());
	}
	public static RandomBankCodeGenerator build(){
		return new RandomBankCodeGenerator();
	}
	
	public String generate(){
		return  (String) this.getRandomObject(bank_bin_models) + this.getRandomNumberString(13);
	}
	
	public Bank generateBank(){
		int index = this.getRangNumber(0, banks_models_list.size());
		Bank bank = banks_models_list.get(index);
		
		if(bank == null) return null;
		int length = bank.getBankLength();
		String bankNo = bank.getBankBin()+""+this.getRandomNumberString(length - bank.getBankBin().length());
		bank.setBankNo(bankNo);
		return bank;
	}
	
	private static final String[] bank_bin_models = {"451291","456351","622752","622753","622754","622755","622756","622757","622758","622759","622760","622761","622762","622763","409666","438088","622750","622751","622770","427020","427030","530990","622230","622235","622210","622215","622200","451804","451804","451810","451810","458060","458060","458071","458071","489734","489735","489736","955880","955881","955882","955888","491020","622821","622822","622823","622824","622825","622826","622836","622837","622840","622844","622845","622846","622847","622848","552599","404119","404121","519412","403361","558730","520083","520082","519413","404120","404118","404117","453242","489592","622700","622725","622728","436742","436745","622280","622678","622679","622680","622688","622689","622690","622691","622692","622696","622698","376968","376966","622918","622916","518212","520108","376969","622919","556617","403391","558916","514906","400360","433669","433667","433666","404173","404172","404159","404158","403393","403392","433668","404157","404171","404174","628209","628208","628206","458123","458124","521899","622260","456418","843010","843360","843420","843610","843730","843800","843850","843900","870000","870100","870300","870400","870500","984301","418152","622521","404738","404739","498451","622517","622518","515672","517650","525998","356850","356851","356852","468203","479228","479229","690755","690755","518710","518718","622588","622575","545947","521302","439229","552534","622577","622579","439227","356890","356889","356885","439188","545948","545623","552580","552581","552582","552583","552584","552585","552586","552588","552589","645621","545619","356886","622578","622576","622581","439228","439225","439226","628262","628362","628362","628262","472067","472068","407405","517636","512466","415599","421870","622622","528948","552288","556610","622600","622601","622602","622603","421869","421871","628258","650600","650700","650800","650900","451289","486493","486494","622901","622908","622909","622902","527414","524070","451290","523036","486861","622922","486497","481699","622650","622655","622658","622660","406254","356839","543159","425862","406252","356837","356838","356840","622161","628201","628202","486466","622892","682900","402674","487013","685800","685800","685800","622568","520152","520382","911121","548844","512431","520194","622318","622778","622282","622898","622900","694301","435744","622526","435745","998801","998802","622525","622538","622155","622156","528020","526855","622632","622633","539867","528709","523959","622637","622636","528708","539868","622877","622879","622681","622682","622684","622884","622880","622881","622777","622188","602969","622855","622856","622858","622859","622860","622861","622864","622865","622866","622867","622885","622869","622870","622871","622878","622882","622886","622891","622893","622895","622897","683970","695800","888000"};
	
	private static final List<Bank> banks_models_list = new ArrayList<Bank>();
	
	 
	static{
		banks_models_list.add(new Bank("深圳发展银行", "03070000", "人民币信用卡金卡", "贷记卡", 16, "622525")); 
		banks_models_list.add(new Bank("深圳发展银行", "03070000", "人民币信用卡普卡", "贷记卡", 16, "622526")); 
		banks_models_list.add(new Bank("深圳发展银行", "03070010", "发展卡", "借记卡", 16, "622538")); 
		banks_models_list.add(new Bank("大丰银行有限公司", "25250446", "人民币借记卡", "借记卡", 19, "622546")); 
		banks_models_list.add(new Bank("大丰银行有限公司", "25250446", "港币借记卡", "借记卡", 19, "622547")); 
		banks_models_list.add(new Bank("大丰银行有限公司", "25250446", "澳门币借记卡", "借记卡", 19, "622548")); 
		banks_models_list.add(new Bank("哈萨克斯坦国民储蓄银行", "26330398", "Halykbank Classic", "借记卡", 16, "622549")); 
		banks_models_list.add(new Bank("哈萨克斯坦国民储蓄银行", "26330398", "Halykbank Golden", "借记卡", 16, "622550")); 
		banks_models_list.add(new Bank("德阳市商业银行", "04986580", "锦程卡定活一卡通白金卡", "借记卡", 19, "622561")); 
		banks_models_list.add(new Bank("德阳市商业银行", "04986580", "锦程卡定活一卡通金卡", "借记卡", 19, "622562")); 
		banks_models_list.add(new Bank("德阳市商业银行", "04986580", "锦程卡定活一卡通", "借记卡", 19, "622563")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622575")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622576")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622577")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622578")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622579")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "一卡通", "借记卡", 16, "622580")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622581")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "招商银行信用卡", "贷记卡", 16, "622582")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "一卡通", "借记卡", 16, "622588")); 
		banks_models_list.add(new Bank("招商银行", "03080000", "公司卡", "借记卡", 16, "622598")); 
		banks_models_list.add(new Bank("民生银行", "03050001", "民生信用卡", "贷记卡", 16, "622600")); 
		banks_models_list.add(new Bank("民生银行", "03050001", "民生信用卡", "贷记卡", 16, "622601")); 
		banks_models_list.add(new Bank("中国民生银行", "03050001", "民生银联白金信用卡", "贷记卡", 16, "622602")); 
		banks_models_list.add(new Bank("中国民生银行", "03050001", "民生银联商务信用卡", "贷记卡", 16, "622603")); 
		banks_models_list.add(new Bank("民生银行", "03050000", "民生借记卡", "借记卡", 16, "622615")); 
		banks_models_list.add(new Bank("中国民生银行", "03050000", "民生借记卡", "借记卡", 16, "622617")); 
		banks_models_list.add(new Bank("中国民生银行", "03050000", "民生借记卡", "借记卡", 16, "622619")); 
		banks_models_list.add(new Bank("中国民生银行", "03050000", "民生借记卡", "借记卡", 16, "622622")); 
		banks_models_list.add(new Bank("华夏银行", "03040000", "华夏卡", "借记卡", 16, "622630")); 
		banks_models_list.add(new Bank("华夏银行", "03040000", "华夏至尊金卡", "借记卡", 16, "622631")); 
		banks_models_list.add(new Bank("华夏银行", "03040000", "华夏丽人卡", "借记卡", 16, "622632")); 
		banks_models_list.add(new Bank("华夏银行", "03040000", "华夏万通卡", "借记卡", 16, "622633")); 
		banks_models_list.add(new Bank("中国光大银行", "03030000", "炎黄卡普卡", "贷记卡", 16, "622650")); 
		banks_models_list.add(new Bank("中国光大银行", "03030000", "炎黄卡白金卡", "贷记卡", 16, "622655")); 
		banks_models_list.add(new Bank("中国光大银行", "03030000", "炎黄卡金卡", "贷记卡", 16, "622658")); 
		banks_models_list.add(new Bank("光大银行", "03030000", "阳光卡", "借记卡", 16, "622660")); 
		banks_models_list.add(new Bank("中信实业银行信用卡中心", "03020000", "中信银联标准贷记卡", "贷记卡", 16, "622678")); 
		banks_models_list.add(new Bank("中信实业银行信用卡中心", "03020000", "中信银联标准贷记卡", "贷记卡", 16, "622679")); 
		banks_models_list.add(new Bank("中信实业银行信用卡中心", "03020000", "中信银联标准贷记卡", "贷记卡", 16, "622680")); 
		banks_models_list.add(new Bank("江西省农村信用社联合社", "14394200", "百福卡", "借记卡", 19, "622681")); 
		banks_models_list.add(new Bank("江西省农村信用社联合社", "14394200", "百福卡", "借记卡", 19, "622682")); 
		banks_models_list.add(new Bank("渤海银行", "03170000", "渤海银行公司借记卡", "借记卡", 16, "622684")); 
		banks_models_list.add(new Bank("中信实业银行信用卡中心", "03020000", "中信银联标准贷记卡", "贷记卡", 16, "622688")); 
		banks_models_list.add(new Bank("中信实业银行信用卡中心", "03020000", "中信银联标准贷记卡", "贷记卡", 16, "622689")); 
		banks_models_list.add(new Bank("中信实业银行", "03020000", "中信借记卡", "借记卡", 16, "622690")); 
		banks_models_list.add(new Bank("中信实业银行", "03020000", "中信借记卡", "借记卡", 16, "622691")); 
		banks_models_list.add(new Bank("中信实业银行", "03020000", "中信贵宾卡", "借记卡", 16, "622692")); 
		banks_models_list.add(new Bank("中信银行", "03020000", "中信理财宝金卡", "借记卡", 16, "622696")); 
		banks_models_list.add(new Bank("中信银行", "03020000", "中信理财宝白金卡", "借记卡", 16, "622698")); 
		banks_models_list.add(new Bank("建设银行", "01050000", "龙卡储蓄卡", "借记卡", 19, "622700")); 
		banks_models_list.add(new Bank("中国建设银行", "01050000", "龙卡准贷记卡", "准贷记卡", 16, "622725")); 
		banks_models_list.add(new Bank("中国建设银行", "01050000", "龙卡准贷记卡金卡", "准贷记卡", 16, "622728")); 
		banks_models_list.add(new Bank("中国银行澳门分行", "01040446", "人民币信用卡", "信用卡", 16, "622750")); 
		banks_models_list.add(new Bank("中国银行澳门分行", "01040446", "人民币信用卡", "信用卡", 16, "622751")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城人民币信用卡", "准贷记卡", 16, "622752")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城人民币信用卡", "准贷记卡", 16, "622753")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城人民币信用卡", "准贷记卡", 16, "622755")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城人民币信用卡", "准贷记卡", 16, "622756")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城人民币信用卡", "准贷记卡", 16, "622757")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城人民币信用卡", "准贷记卡", 16, "622758")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城信用卡", "准贷记卡", 16, "622759")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "银联单币贷记卡", "贷记卡", 16, "622760")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城信用卡", "准贷记卡", 16, "622761")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城信用卡", "准贷记卡", 16, "622762")); 
		banks_models_list.add(new Bank("中国银行", "01040000", "长城信用卡", "准贷记卡", 16, "622763")); 
		banks_models_list.add(new Bank("中国银行澳门分行", "01040446", "中银卡", "借记卡", 19, "622770")); 
		banks_models_list.add(new Bank("曲靖市商业银行", "05027360", "珠江源卡", "借记卡", 16, "622777")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗校园卡", "借记卡", 19, "622821")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗星座卡", "借记卡", 19, "622822")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗社保卡", "借记卡", 19, "622823")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗旅游卡", "借记卡", 19, "622824")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗青年卡", "借记卡", 19, "622825")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "复合介质金穗通宝卡", "借记卡", 19, "622826")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗贷记卡", "贷记卡", 16, "622836")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗贷记卡", "贷记卡", 16, "622837")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗通宝卡", "借记卡", 19, "622840")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗通宝卡", "借记卡", 19, "622844")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗通宝卡", "借记卡", 19, "622845")); 
		banks_models_list.add(new Bank("中国农业银行", "01030000", "金穗通宝卡", "借记卡", 19, "622846")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗通宝卡", "借记卡", 19, "622847")); 
		banks_models_list.add(new Bank("农业银行", "01030000", "金穗通宝卡", "借记卡", 19, "622848")); 
		banks_models_list.add(new Bank("江苏东吴农村商业银行", "14303050", "新苏卡", "借记卡", 19, "622855")); 
		banks_models_list.add(new Bank("桂林市商业银行", "04916170", "漓江卡", "借记卡", 17, "622856")); 
		banks_models_list.add(new Bank("日照市商业银行", "03134732", "黄海卡", "借记卡", 19, "622857")); 
		banks_models_list.add(new Bank("浙江省农村信用社联合社", "14293300", "丰收卡", "借记卡", 19, "622858")); 
		banks_models_list.add(new Bank("珠海农村信用合作社联社", "14315850", "信通卡", "借记卡", 19, "622859")); 
		banks_models_list.add(new Bank("大庆市商业银行", "04922690", "玉兔卡", "借记卡", 16, "622860")); 
		banks_models_list.add(new Bank("澳门永亨银行股份有限公司", "26080446", "人民币卡", "借记卡", 16, "622861")); 
		banks_models_list.add(new Bank("莱芜市商业银行", "04974634", "金凤卡", "借记卡", 16, "622864")); 
		banks_models_list.add(new Bank("长春市商业银行", "04062410", "君子兰一卡通", "借记卡", 19, "622865")); 
		banks_models_list.add(new Bank("徐州市商业银行", "04943030", "彭城借记卡", "借记卡", 16, "622866")); 
		banks_models_list.add(new Bank("重庆市农村信用社联合社", "14136530", "信合平安卡", "借记卡", 16, "622867")); 
		banks_models_list.add(new Bank("太仓农村商业银行", "14333051", "郑和卡", "借记卡", 19, "622869")); 
		banks_models_list.add(new Bank("靖江市长江城市信用社", "04933120", "长江卡", "借记卡", 16, "622870")); 
		banks_models_list.add(new Bank("永亨银行", "25060344", "永亨尊贵理财卡", "借记卡", 16, "622871")); 
		banks_models_list.add(new Bank("徽商银行", "04403600", "黄山卡", "借记卡", 19, "622877")); 
		banks_models_list.add(new Bank("杭州市商业银行", "04233310", "西湖卡", "借记卡", 18, "622878")); 
		banks_models_list.add(new Bank("徽商银行", "04403600", "黄山卡", "借记卡", 19, "622879")); 
		banks_models_list.add(new Bank("柳州市商业银行", "04956140", "龙城卡", "借记卡", 16, "622880")); 
		banks_models_list.add(new Bank("柳州市商业银行", "04956140", "龙城卡", "借记卡", 16, "622881")); 
		banks_models_list.add(new Bank("尧都区农村信用合作社联社", "14341770", "天河卡", "借记卡", 19, "622882")); 
		banks_models_list.add(new Bank("渤海银行", "03170000", "渤海银行借记卡", "借记卡", 16, "622884")); 
		banks_models_list.add(new Bank("重庆市农村信用社联合社", "14136530", "信合希望卡", "借记卡", 16, "622885")); 
		banks_models_list.add(new Bank("烟台市商业银行", "03134560", "金通卡", "借记卡", 16, "622886")); 
		banks_models_list.add(new Bank("武进农村商业银行", "14353041", "阳湖卡", "借记卡", 19, "622891")); 
		banks_models_list.add(new Bank("上海银行", "04012900", "申卡借记卡", "借记卡", 18, "622892")); 
		banks_models_list.add(new Bank("贵州省农村信用社联合社", "14367000", "信合卡", "借记卡", 19, "622893")); 
		banks_models_list.add(new Bank("江苏锡州农村商业银行", "14373020", "金阿福", "借记卡", 16, "622895")); 
		banks_models_list.add(new Bank("中外合资.南充市商业银行", "04966730", "熊猫团团卡", "借记卡", 19, "622897")); 
		banks_models_list.add(new Bank("长沙市商业银行", "04615511", "芙蓉贷记卡", "贷记卡", 16, "622898")); 
		banks_models_list.add(new Bank("长沙市商业银行", "04615511", "芙蓉贷记卡", "贷记卡", 16, "622900")); 
		banks_models_list.add(new Bank("兴业银行", "03090010", "银联信用卡", "贷记卡", 16, "622901")); 
		banks_models_list.add(new Bank("兴业银行", "03090000", "兴业自然人生理财卡", "借记卡", 18, "622908")); 
		banks_models_list.add(new Bank("兴业银行", "03090002", "万能卡", "借记卡", 16, "622909")); 
		banks_models_list.add(new Bank("Discover Financial Services，Inc", "26290840", "发现卡", "贷记卡", 16, "650600")); 
		banks_models_list.add(new Bank("Discover Financial Services，Inc", "26290840", "发现卡", "贷记卡", 16, "650700")); 
		banks_models_list.add(new Bank("Discover Financial Services，Inc", "26290840", "发现卡", "贷记卡", 16, "650800")); 
		banks_models_list.add(new Bank("Discover Financial Services，Inc", "26290840", "发现卡", "贷记卡", 16, "650900")); 
		banks_models_list.add(new Bank("上海银行", "04012900", "上海明珠卡", "借记卡", 18, "682900")); 
		banks_models_list.add(new Bank("泉州市商业银行", "04643970", "海峡储蓄卡", "借记卡", 18, "683970")); 
		banks_models_list.add(new Bank("广东发展银行", "03060000", "广发理财通", "借记卡", 18, "685800")); 
		banks_models_list.add(new Bank("广东发展银行", "03060000", "广发信用卡", "信用卡", 16, "685800")); 
		banks_models_list.add(new Bank("广东发展银行", "03060000", "广发VISA信用卡", "信用卡", 16, "68580")); 
		banks_models_list.add(new Bank("招商", "03080000", "招行一卡通", "储蓄卡", 15, "690755")); 
		banks_models_list.add(new Bank("招商", "03080000", "招行一卡通", "储蓄卡", 18, "690755")); 
		banks_models_list.add(new Bank("长沙市商业银行", "04615510", "芙蓉卡", "借记卡", 18, "694301")); 
		banks_models_list.add(new Bank("南通商业银行", "04523060", "金桥卡", "借记卡", 18, "695800")); 
	}
}
